<#setting number_format="0.####">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>demo</title>
<link href="../css/main.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../js/jquery-ui-1.7.3.custom.css" type="text/css" />
<script type="text/javascript" src="../js/swfobject.js"/></script>
<script src="../js/jquery.js" type="text/javascript"></script>
<script src="../js/jquery.ui.core.js" type="text/javascript"></script>
<script src="../js/jquery.ui.datepicker.js" type="text/javascript"></script>
<script src="../jlib/windows/jdialog.js" type="text/javascript"></script><SCRIPT LANGUAGE="JavaScript">
<!--
$(function(){
	$("#more_search").click(function(){
		$(this).boxto({title:"查询", url: this.href,width:650, height:440, moveable:true});
		return false;
	});				
	$(".view").click(function(){
		$(this).boxto({title:"编辑", url: this.href,width:650, height:440, moveable:true});
		return false;
	});
	
	$("#date").datepicker({dateFormat:"yy-mm-dd"});
	
});
<#if vo??>
swfobject.embedSWF("../open-flash-chart.swf", "my_chart", "1280", "300", "9.0.0");
<#assign hours = ['0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20','21','22','23'] >
<#list vo.sbzbs as sbzb>
var json_${sbzb.zbdm} = {
	  "elements":[
	    {
	      "type":      "bar",
	      "alpha":     0.5,
	      "colour":    "#9933CC",
	      "text":      "最大值",
	      "font-size": 10,
	      "values" :   [<#list hours as key>${(vo.timeMap[key].jkzbMap[sbzb.zbdm].max)!0},</#list>,0]
	    },
	    {
	      "type":      "bar",
	      "alpha":     0.5,
	      "colour":    "#CC9933",
	      "text":      "平均值",
	      "font-size": 10,
	      "values" :   [<#list hours as key>${(vo.timeMap[key].jkzbMap[sbzb.zbdm].avg)!0},</#list>,0]
	    },
	    {
	      "type":      "bar",
	      "alpha":     0.5,
	      "colour":    "#CC99DD",
	      "text":      "最小值",
	      "font-size": 10,
	      "values" :   [<#list hours as key>${(vo.timeMap[key].jkzbMap[sbzb.zbdm].min)!0},</#list>,0]
	    }
	  ],
	 
	  "x_axis":{
	    "stroke":1,
	    "tick_height":10,
	    "colour":"#d000d0",
	    "grid_colour":"#00ff00",
	    "labels": {
	        "labels": ["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24"]
	    }
	   },
	 <#assign max = (vo.maxMap[sbzb.zbdm])!20>
	 <#assign steps = max/10>
	  "y_axis":{
	    "stroke":      4,
	    "tick_length": 3,
	    "colour":      "#d000d0",
	    "grid_colour": "#00ff00",
	    "offset":      0,
	    "max":         ${max},
	    "steps":${steps}
	  }
	}; 
</#list>

function open_flash_chart_data(){
	
	return JSON.stringify(json_${vo.sbzbs?first.zbdm})
}
function loadChart(){
	var tmp = findSWF("my_chart");
	var zb = $("#sbzb").val();
	var json = eval("json_"+zb);
	x = tmp.load( JSON.stringify(json) );
	
}
function findSWF(movieName) {
  if (navigator.appName.indexOf("Microsoft")!= -1) {
    return window[movieName];
  } else {
    return document[movieName];
  }
}
</#if>
function sub(){
	if($("#sbids").val()==null || $("#sbids").val()==""){
		alert("请选择企业");
		return;
	}
	if($("#date").val()==null || $("#date").val()==""){
		alert("日期不能为空");
		return;
	}
	$("form").submit();
}
function closediv() {
	$.boxit.closeAll();
}
//-->
</SCRIPT>
</head>
<body>
<table width="99%" cellpadding="0" cellspacing="0" class="table" >
<form action="search.htm" method="post">
	<input type="hidden" name="sbid" value="${qysbxxs?first.sbid}">
	<input type="hidden" name="qydm" value="${qydm}">
  <tr>
    <td width="5%" align="center" class="rowColor rowColorRight">企业</td>
    <td width="15%" class="row rowLeft">
		${qyxx.qymc}
	</td>
	<td width="5%" align="center" class="rowColor rowColorRight">监测设备</td>
    <td width="5%" class="row rowLeft">
    	${qysbxxs?first.sbmc}
	</td>
	<td width="5%" align="center" class="rowColor rowColorRight">日期</td>
    <td width="38%" class="row rowLeft">
    	<input type="text" name="date" id="date" value="${date!''}" readonly >
    	<input type="radio" name="chartType">直方图
    	<input type="radio" name="chartType">曲线
    	<input type="submit">
	</td>
  </tr>
</form>  
</table>
<#if vo??>
<table width="99%" cellpadding="0" cellspacing="0" class="table" >
  <tr>
    <td width="5%" align="center" class="rowColor rowColorRight">监控指标</td>
    <td width="15%" class="row rowLeft">
		<select id="sbzb" onchange="loadChart()">
			<#list vo.sbzbs as sbzb>
			<option value="${sbzb.zbdm}">${sbzb.zbmc}</option>
			</#list>
		</select>
	</td>
	<td width="5%" align="center" class="rowColor rowColorRight">数据单位</td>
    <td width="5%" class="row rowLeft">
    	${vo.sbzbs?first.sjdw}
	</td>
  </tr>
</form>  
</table>
</#if>
<div class="btnDiv" id="my_chart">报表


</div>

<#if vo??>
<table id="result" width="99%" cellpadding="0" cellspacing="0" class="table" >
 
  <tr value="">
    <td width="250"  class="gridSubTitle">指标</td>
    <#list vo.sbzbs as sbzb>
    <td width="200"  class="gridSubTitle"> 
    	${sbzb.zbmc}</td>
    </#list>
  </tr>
  <tr value="">
    <td width="250"  class="gridSubTitle">单位</td>
    <#list vo.sbzbs as sbzb>
    <td width="200"  class="gridSubTitle"> 
    	${sbzb.sjdw}</td>
    </#list>
  </tr>
  <tr value="">
    <td width="250"  class="gridSubTitle">类型</td>
    <#list vo.sbzbs as sbzb>
    <td width="200"  class="gridSubTitle"> 
    	<table width="100%">
    		<tr>
    			<td>最小值</td>
    			<td>平均值</td>
    			<td>最大值</td>
    		</tr>
    	</table>	
    </td>
    </#list>
  </tr>
  <#list vo.timeVOs as time>
  <tr class="row">
    <td class="gridCenter">${time.time?string("HH:mm")}</td>
    <#list time.jkzbs as jkzb>
    <td class="gridCenter">
    	<table width="100%">
    		<tr>
    			<td width="33%">${jkzb.min?string("#.##")}</td>
    			<td width="33%">${jkzb.avg?string("#.##")}</td>
    			<td width="33%">${jkzb.max?string("#.##")}</td>
    		</tr>
    	</table>
    </td>
    </#list>
  </tr>
  </#list>
</table>
</#if>
</body>
</html>
